package core.conditions;

public class Counter extends Condition {
	
	private int myResetValue;
	private int myLimit;
	
	public Counter(String name, int limit)
	{
		super(name);
		myLimit = myResetValue = limit;
	}

	public boolean finished() {
		return (myLimit <= 0);
	}

	public void step() {
		myLimit--;
	}
	
	public void reset() {
		myLimit = myResetValue;
	}

}
